package controller;

import entity.User;
import service.Impl.UserServiceImpl;
import service.UserService;

import java.util.List;

public class UserController {
    UserService userService=new UserServiceImpl();
    public boolean customerLogin(Integer id, String passWord){
        return userService.customerLogin(id,passWord);
    }
    public boolean sellerLogin(Integer id,String passWord){
        return userService.sellerLogin(id, passWord);
    }
    public boolean administratorLogin(Integer id, String passWord){
        return userService. administratorLogin(id,passWord);
    }
    public boolean registerUser(User user){
        return userService.registerUser(user);
    }
    public boolean insertUser(User user){
        return userService.insertUser(user);
    }
    public boolean deleteUserById(Integer id){
        return userService.deleteUserById(id);
    }
    public boolean updateUserById(Integer id,User user){
        return userService.updateUserById(id,user);
    }
    public User selectUserById(Integer id){
        return userService.selectUserById(id);
    }
    public User selectUserByUserName(String userName){
        return userService.selectUserByUserName(userName);
    }
    public List<User> selectAllUser(){
        return userService.selectAllUser();
    }
}
